<?php
header('Content-Type: text/html; charset=utf-8');
if($_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest') {
	
	if($_GET['country']==1) {
        switch($_GET['auto']) {
        	case '1':
        	print '[{value:"",text:"Выбрать модель"},{value:"1",text:"A4"},{value:"2",text:"Q7"},{value:"3",text:"TT"}]';
        	break;
        	case '2':
        	print '[{value:"",text:"Выбрать модель"},{value:"1",text:"6ER"},{value:"2",text:"M"},{value:"3",text:"X6"}]';
        	break;
        	case '3':
        	print '[{value:"",text:"Выбрать модель"},{value:"1",text:"Astra"},{value:"2",text:"Corsa"},{value:"3",text:"Vectra"}]';
        	break;
        	default:
        	print '[{value:"",text:"Выбрать модель"}]';
        	break;
        }
	} elseif($_GET['country']==2) {
		switch($_GET['auto']) {
        	case '1':
        	print '[{value:"",text:"Выбрать модель"},{value:"1",text:"Matiz"},{value:"2",text:"Nexia"}]';
        	break;
        	case '2':
        	print '[{value:"",text:"Выбрать модель"},{value:"1",text:"Accent"},{value:"2",text:"Elantra"},{value:"3",text:"Sonata"}]';
        	break;
        	case '3':
        	print '[{value:"",text:"Выбрать модель"},{value:"1",text:"Carnival"},{value:"2",text:"Picanto"},{value:"3",text:"Spectra"}]';
        	break;
        	default:
        	print '[{value:"",text:"Выбрать модель"}]';
        	break;
        }
	} elseif($_GET['country']==3) {
		switch($_GET['auto']) {
        	case '1':
        	print '[{value:"",text:"Выбрать модель"},{value:"1",text:"Accord"},{value:"2",text:"Civic"},{value:"3",text:"CR-V"}]';
        	break;
        	case '2':
        	print '[{value:"",text:"Выбрать модель"},{value:"1",text:"Mazda 3"},{value:"2",text:"Mazda 5"},{value:"3",text:"Mazda 6"}]';
        	break;
        	case '3':
        	print '[{value:"",text:"Выбрать модель"},{value:"1",text:"Corolla"},{value:"2",text:"LandCruiser"},{value:"3",text:"RAV4"}]';
        	break;
        	default:
        	print '[{value:"",text:"Выбрать модель"}]';
        	break;
        }
	} else {
		print '[{value:"",text:"Выбрать модель"}]';
	}
}
?>